package com.loie.datacenter.model.stockpo;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@JsonPropertyOrder({"time", "type", "price","quantity","stocknum","stockamount","cash"})

public class TradeLog {
    LocalDateTime time;
    String type;
    double price;
    int quantity;
    int stocknum;
    double stockamount;
    double cash;
    double baseprice;
    double totalamout;
    double firstcash;
    double profit;

    public TradeLog(LocalDateTime time, String type, double price, int quantity,int stocknum,double amount,double cash,double baseprice,double firstcash) {
        this.time  = time;
        this.type  = type;
        this.price  = price;
        this.quantity  = quantity;
        this.stocknum=stocknum;
        this.stockamount=amount;
        this.cash=cash;
        this.baseprice=baseprice;
        this.totalamout=amount+cash;
        this.firstcash=firstcash;
        this.profit=this.totalamout-this.firstcash;
    }
}
